import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/route/index.dart';
import 'package:gourmet/ui/draw_under_line.dart';
import 'package:gourmet/ui/picker.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:sticky_headers/sticky_headers.dart';

class MinePaymentBillController extends GetxController {
  RxInt selectedIndex = RxInt(0);

  List<String> selected = ['全部类型', '外卖订单', '到店自取订单', '团购订单', '退款', '其他'];
}

class MinePaymentBillPage extends GetView<MinePaymentBillController> {
  const MinePaymentBillPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeBottom: true,
      removeLeft: true,
      removeRight: true,
      child: Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          leading: IconButton(
            onPressed: Get.back,
            icon: Icon(
              CupertinoIcons.chevron_back,
              size: 18,
              color: HexColor(ColorsUtils.color0000),
            ),
          ),
          backgroundColor: Colors.white,
          systemOverlayStyle: SystemUiOverlayStyle.dark,
          centerTitle: true,
          title: Text(
            '账单',
            style: StylesUtils.customTextStyle(
              fontSize: StylesUtils.fontSize18,
              fontWeight: FontWeight.w700,
              color: ColorsUtils.color0000,
            ),
          ),
          bottom: PreferredSize(
            preferredSize: const Size.fromHeight(40),
            child: Container(
              height: 40,
              alignment: Alignment.centerLeft,
              padding: const EdgeInsets.symmetric(horizontal: 20),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Builder(
                    builder: (builder) => GestureDetector(
                      onTap: () {
                        showPickerDateTime(builder);
                      },
                      child: Text.rich(
                        TextSpan(
                          children: [
                            TextSpan(
                              text: '2024-07 ',
                              style: StylesUtils.customTextStyle(
                                fontSize: StylesUtils.fontSize15,
                                color: ColorsUtils.color0000,
                              ),
                            ),
                            WidgetSpan(
                              child: Icon(
                                CupertinoIcons.arrowtriangle_down_fill,
                                size: 12,
                                color: HexColor(ColorsUtils.color9999),
                              ),
                              alignment: PlaceholderAlignment.middle,
                            ),
                          ],
                        ),
                      ),
                    ),
                  ),
                  GestureDetector(
                    onTap: () {
                      openSelectedType(context);
                    },
                    child: Text.rich(
                      TextSpan(
                        children: [
                          TextSpan(
                            text: '全部类型 ',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize15,
                              color: ColorsUtils.color0000,
                            ),
                          ),
                          WidgetSpan(
                            child: Icon(
                              CupertinoIcons.arrowtriangle_down_fill,
                              size: 12,
                              color: HexColor(ColorsUtils.color9999),
                            ),
                            alignment: PlaceholderAlignment.middle,
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        body: ListView(
          children: [
            for (var i = 0; i < 10; i++)
              GestureDetector(
                child: StickyHeader(
                  header: Container(
                    height: 40,
                    padding: const EdgeInsets.only(left: 15),
                    alignment: Alignment.centerLeft,
                    color: HexColor(ColorsUtils.colorF5f5),
                    child: Text(
                      '支出￥${Random.secure().nextInt(500)}　收入￥${Random.secure().nextInt(100)}',
                      style: StylesUtils.customTextStyle(
                        fontSize: StylesUtils.fontSize13,
                        color: ColorsUtils.color7979,
                      ),
                    ),
                  ),
                  content: Column(
                    children: [
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=2653229512,626357619&fm=253&fmt=auto&app=138&f=JPG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_华莱士 (凤凰店铺)',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥35',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=4059866947,1791175326&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_龙凤茶楼',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥75',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                CircleAvatar(
                                  radius: 20,
                                  backgroundColor: HexColor('#3478f6'),
                                  child: Text(
                                    '退',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '退款_顺德佬',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '+￥30',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '支付宝',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=2653229512,626357619&fm=253&fmt=auto&app=138&f=JPG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_华莱士 (凤凰店铺)',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥35',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=4059866947,1791175326&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_龙凤茶楼',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥75',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                CircleAvatar(
                                  radius: 20,
                                  backgroundColor: HexColor('#3478f6'),
                                  child: Text(
                                    '退',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '退款_顺德佬',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '+￥30',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '支付宝',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=2653229512,626357619&fm=253&fmt=auto&app=138&f=JPG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_华莱士 (凤凰店铺)',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥35',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=4059866947,1791175326&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_龙凤茶楼',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥75',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                CircleAvatar(
                                  radius: 20,
                                  backgroundColor: HexColor('#3478f6'),
                                  child: Text(
                                    '退',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '退款_顺德佬',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '+￥30',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '支付宝',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=2653229512,626357619&fm=253&fmt=auto&app=138&f=JPG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_华莱士 (凤凰店铺)',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥35',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                Image.network(
                                  'https://img2.baidu.com/it/u=4059866947,1791175326&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                                  width: 40,
                                  height: 40,
                                  fit: BoxFit.fill,
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '外卖订单_龙凤茶楼',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '-￥75',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '微信支付',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                      Padding(
                        padding:
                            const EdgeInsets.only(top: 15, left: 15, right: 15),
                        child: DrawUnderLine(
                          child: Padding(
                            padding: const EdgeInsets.only(bottom: 20),
                            child: Row(
                              children: [
                                CircleAvatar(
                                  radius: 20,
                                  backgroundColor: HexColor('#3478f6'),
                                  child: Text(
                                    '退',
                                    style: StylesUtils.customTextStyle(
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 10, right: 5),
                                    child: Column(
                                      children: [
                                        Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.spaceBetween,
                                          children: [
                                            Container(
                                              constraints: const BoxConstraints(
                                                  maxWidth: 175, maxHeight: 30),
                                              alignment: Alignment.centerLeft,
                                              child: Text(
                                                '退款_顺德佬',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  color: ColorsUtils.color0000,
                                                  fontSize:
                                                      StylesUtils.fontSize16,
                                                ),
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              ),
                                            ),
                                            Container(
                                              height: 30,
                                              alignment: Alignment.centerRight,
                                              child: Text(
                                                '+￥30',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                        fontSize: StylesUtils
                                                            .fontSize17,
                                                        color: ColorsUtils
                                                            .color0000),
                                              ),
                                            ),
                                          ],
                                        ),
                                        SizedBox(
                                          height: 30,
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Text(
                                                '2097-12-26 17:41:17',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                              Text(
                                                '支付宝',
                                                style:
                                                    StylesUtils.customTextStyle(
                                                  fontSize:
                                                      StylesUtils.fontSize13,
                                                  color: ColorsUtils.color7979,
                                                ),
                                              ),
                                            ],
                                          ),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                                Center(
                                  child: Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 12,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
                onTap: () {
                  Get.toNamed(Routes.mineBillInfo);
                },
              ),
          ],
        ),
      ),
    );
  }

  void showPickerDateTime(BuildContext context) {
    Picker(
        adapter: DateTimePickerAdapter(
          type: PickerDateTimeType.kYM,
          isNumberMonth: true,
          yearSuffix: '年',
          monthSuffix: '月',
          minValue: DateTime(210, 1),
          minuteInterval: 30,
        ),
        itemExtent: 40,
        height: 250,
        textAlign: TextAlign.center,
        backgroundColor: Colors.white,
        builderHeader: (_) {
          return Container(
            height: 40,
            padding: const EdgeInsets.symmetric(horizontal: 20),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: const BorderRadius.only(
                topLeft: Radius.circular(10),
                topRight: Radius.circular(10),
              ),
              border: Border(
                bottom: BorderSide(
                  color: HexColor(ColorsUtils.colorF5f5),
                ),
              ),
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                GestureDetector(
                  onTap: () {
                    Get.back();
                  },
                  child: Text(
                    '取消',
                    style: StylesUtils.customTextStyle(
                      fontSize: StylesUtils.fontSize17,
                      color: ColorsUtils.color0000,
                    ),
                  ),
                ),
                GestureDetector(
                  onTap: () {
                    Get.back();
                  },
                  child: Text(
                    '确定',
                    style: StylesUtils.customTextStyle(
                      fontSize: StylesUtils.fontSize17,
                      color: ColorsUtils.colorFf64,
                    ),
                  ),
                ),
              ],
            ),
          );
        },
        onSelect: (Picker picker, int index, List<int> selected) {
          Get.log('selected = ${picker.adapter.text}');
        }).showModal(context);
  }

  void openSelectedType(BuildContext context) {
    showModalBottomSheet(
        context: context,
        elevation: 0,
        backgroundColor: Colors.white,
        barrierColor: ColorsUtils.rgba(0, 0, 0, 0.298039215686275),
        // constraints: const BoxConstraints(maxHeight: 300),
        clipBehavior: Clip.none,
        useSafeArea: true,
        builder: (_) {
          return Column(
            children: [
              Stack(
                children: [
                  Container(
                    height: 50,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                      borderRadius: const BorderRadius.only(
                        topLeft: Radius.circular(5),
                        topRight: Radius.circular(5),
                      ),
                      border: Border(
                        bottom: BorderSide(
                          color: HexColor(ColorsUtils.colorF5f5),
                        ),
                      ),
                    ),
                    child: Text(
                      '选择交易类型',
                      style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize16,
                          fontWeight: FontWeight.w700,
                          color: ColorsUtils.color0000),
                    ),
                  ),
                  Positioned.fromRect(
                    rect: const Rect.fromLTWH(0, 0, 40, 50),
                    child: GestureDetector(
                      onTap: Get.back,
                      child: Center(
                        child: Icon(
                          CupertinoIcons.multiply,
                          size: 20,
                          color: HexColor(ColorsUtils.color9999),
                        ),
                      ),
                    ),
                  ),
                ],
              ),
              ...controller.selected
                  .asMap()
                  .map(
                    (key, value) => MapEntry(
                      key,
                      Obx(
                        () => GestureDetector(
                          onTap: () {
                            controller.selectedIndex.value = key;
                            Get.back();
                          },
                          child: DrawUnderLine(
                            dx: 20,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 20),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    value,
                                    style: StylesUtils.customTextStyle(
                                        fontSize: StylesUtils.fontSize16,
                                        color: ColorsUtils.color0000),
                                  ),
                                  controller.selectedIndex.value == key
                                      ? Icon(
                                          CupertinoIcons
                                              .checkmark_alt_circle_fill,
                                          size: 20,
                                          color:
                                              HexColor(ColorsUtils.colorFf64),
                                        )
                                      : Icon(
                                          CupertinoIcons.circle,
                                          size: 20,
                                          color:
                                              HexColor(ColorsUtils.color9999),
                                        ),
                                ],
                              ),
                            ),
                          ),
                        ),
                      ),
                    ),
                  )
                  .values
            ],
          );
        });
  }
}
